# coding: utf-8
name = 'will'
'''*raw_input()*/'''
print 'hello world',name
#单行注释
'''多行
注释'''
a = 100
if a>400:
	print a
else :
	print a*-1

print 0x100
print 1.12e6#科学记数法表示浮点数
print "I'm \twho"
print "\n"
print 'ab says "i\'m back" '#斜杠转义
print r'asdad\'says\'vssw\n'#r免转义
print '''line1
line2'''

#布尔值
print 3>2;print 3<2
print 3>2 and 2>1 or 1>0
print "3>2?" + str(not 3>2)

#空值与变量
varA = None
print varA
varA = 1
print varA
varA ="aaa"
print varA
#变量可以任意类型，感觉上类似于引用

#常量
#print PI

#字符集问题
print 'A in ASCII is '+ str(ord('A')) + ';65 in ASCII is ' + chr(65)

print u'中国'.encode('utf-8')

#字符串格式化
print 'hello,%s' %'Bert'
print 'dear %s,Your Balance is %d' %('will',10000)
print '%5d %.3f' %(309,3.141593)#补空格与小数保留位数
print 'the level is %d%%' % 30 #百分号转义
print 'your name？%s' % '张三'

#条件判断与循环
#if
age=30
if age>50:
	print 'oldman'
elif age>18:
	print 'adult'
else:
	print 'child'
	print 'Readme1'
print 'Readme2'
#↑if会根据缩进确定是否执行

#for
for x in ('no1','no2','no3'):
	print x
for x in range(10):
	print x

#while
sum = 0
n= 1
while n<100 :
	n= n+2
	sum = sum + n
print sum
